﻿namespace TG
{
    public class TreasureBox : EntityBase
    {
        public TreasureBoxType treasureBoxType;
        public override MapItemType mapItemType => MapItemType.TreasureBox;

        public void Init(MapCell mapCell, TreasureBoxType treasureBoxType)
        {
            base.Init(mapCell);
            this.treasureBoxType = treasureBoxType;
        }

        protected override void Trigger(EntityBase entity)
        {
            base.Trigger(entity);

            switch (treasureBoxType)
            {
                case TreasureBoxType.VacuumCleaner:
                    GameManager.Instance.Player.SetVacuumCleaner(true);
                    break;
                case TreasureBoxType.Cleat:
                    GameManager.Instance.Player.SetCleat(true);
                    break;
            }

            RemoveSelf();
        }
    }
}